package com.train.daily.api;

import com.train.common.constants.ApiConstants;
import com.train.common.resp.CommonResp;
import com.train.daily.api.fallback.DailyTrainSeatApiFallback;
import com.train.daily.dto.seat.DailyTrainSeatQueryListDTO;
import com.train.daily.dto.seat.DailyTrainSeatEditChoiceSeatDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(
        contextId = "dailyTrainSeatApi",
        name = ApiConstants.DAILY_TRAIN_NAME,
        path = ApiConstants.DAILY_TRAIN_PREFIX,
        fallback = DailyTrainSeatApiFallback.class)
public interface DailyTrainSeatApi {

    String PREFIX = "/seat";

    @PostMapping(PREFIX + "/list")
    CommonResp queryTrainSeatList(@RequestBody DailyTrainSeatQueryListDTO dto);

    @PostMapping(PREFIX + "/edit/sell")
    CommonResp batchEditDailyTrainSeat(@RequestBody List<DailyTrainSeatEditChoiceSeatDTO> dto);
}
